﻿namespace HuaWei
{
    using DevExpress.Utils;
    using DevExpress.XtraEditors;
    using HuaWei.CommClass;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Windows.Forms;

    public class FrmGQKK : Form
    {
        private string _str = "\r\n说明：按合同条款分期次扣回预先支付的材料预付款。";
        private BindingSource bindingSource = null;
        private SimpleButton btnCancel;
        private SimpleButton btnOK;
        private TextEdit edtGQ;
        private TextEdit edtKHJDQ;
        private GQKK gqkk = null;
        private IContainer icontainer = null;
        private LabelControl labelControl1;
        private LabelControl labelControl2;
        private LabelControl labelControl3;
        private LabelControl labelControl4;
        private LabelControl labelControl5;

        public FrmGQKK()
        {
            this.InitializeComponent();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            base.DialogResult = System.Windows.Forms.DialogResult.Cancel;
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            this.gqkk.GQ = Convert.ToInt16(this.edtGQ.EditValue);
            this.gqkk.KHJDQ = Convert.ToInt16(this.edtKHJDQ.EditValue);
            DataRow dataRow = DHelp.GetDataRow(this.bindingSource);
            dataRow["KCLYYKGS"] = this.gqkk.ToString();
            string format = "隔期扣回：隔{0}期  扣回进度分{1}期" + this._str;
            dataRow["KCLYYKLXBZ"] = string.Format(format, this.gqkk.GQ, this.gqkk.KHJDQ);
            dataRow.EndEdit();
            base.DialogResult = System.Windows.Forms.DialogResult.OK;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.icontainer != null))
            {
                this.icontainer.Dispose();
            }
            base.Dispose(disposing);
        }

        public void IniForm(BindingSource source)
        {
            this.bindingSource = source;
            DataRow dataRow = DHelp.GetDataRow(this.bindingSource);
            this.gqkk = new GQKK(dataRow["KCLYYKGS"].ToString());
            this.edtGQ.EditValue = this.gqkk.GQ;
            this.edtKHJDQ.EditValue = this.gqkk.KHJDQ;
        }

        private void InitializeComponent()
        {
            this.labelControl1 = new LabelControl();
            this.edtGQ = new TextEdit();
            this.labelControl2 = new LabelControl();
            this.labelControl3 = new LabelControl();
            this.labelControl4 = new LabelControl();
            this.edtKHJDQ = new TextEdit();
            this.btnCancel = new SimpleButton();
            this.btnOK = new SimpleButton();
            this.labelControl5 = new LabelControl();
            this.edtGQ.Properties.BeginInit();
            this.edtKHJDQ.Properties.BeginInit();
            base.SuspendLayout();
            this.labelControl1.Location = new Point(0x6a, 0x30);
            this.labelControl1.Name = "labelControl1";
            this.labelControl1.Size = new Size(12, 14);
            this.labelControl1.TabIndex = 0;
            this.labelControl1.Text = "隔";
            this.edtGQ.Location = new Point(0x7c, 0x2d);
            this.edtGQ.Name = "edtGQ";
            this.edtGQ.Properties.EditFormat.FormatType = FormatType.Numeric;
            this.edtGQ.Size = new Size(0x39, 0x15);
            this.edtGQ.TabIndex = 1;
            this.labelControl2.Location = new Point(0xbb, 0x2f);
            this.labelControl2.Name = "labelControl2";
            this.labelControl2.Size = new Size(12, 14);
            this.labelControl2.TabIndex = 2;
            this.labelControl2.Text = "期";
            this.labelControl3.Location = new Point(0x30, 0x4c);
            this.labelControl3.Name = "labelControl3";
            this.labelControl3.Size = new Size(70, 14);
            this.labelControl3.TabIndex = 3;
            this.labelControl3.Text = "扣回进度(分)";
            this.labelControl4.Location = new Point(0xbb, 0x4a);
            this.labelControl4.Name = "labelControl4";
            this.labelControl4.Size = new Size(12, 14);
            this.labelControl4.TabIndex = 5;
            this.labelControl4.Text = "期";
            this.edtKHJDQ.Location = new Point(0x7c, 0x48);
            this.edtKHJDQ.Name = "edtKHJDQ";
            this.edtKHJDQ.Properties.EditFormat.FormatType = FormatType.Numeric;
            this.edtKHJDQ.Size = new Size(0x39, 0x15);
            this.edtKHJDQ.TabIndex = 4;
            this.btnCancel.Location = new Point(0xa1, 0x79);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new Size(0x4b, 0x17);
            this.btnCancel.TabIndex = 9;
            this.btnCancel.Text = "取消";
            this.btnCancel.Click += new EventHandler(this.btnCancel_Click);
            this.btnOK.Location = new Point(0x3d, 0x79);
            this.btnOK.Name = "btnOK";
            this.btnOK.Size = new Size(0x4b, 0x17);
            this.btnOK.TabIndex = 8;
            this.btnOK.Text = "确定";
            this.btnOK.Click += new EventHandler(this.btnOK_Click);
            this.labelControl5.Location = new Point(12, 12);
            this.labelControl5.Name = "labelControl5";
            this.labelControl5.Size = new Size(0x120, 14);
            this.labelControl5.TabIndex = 10;
            this.labelControl5.Text = "说明：按合同条款分期次扣回预先支付的材料预付款。";
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            base.ClientSize = new Size(0x132, 0xa8);
            base.Controls.Add(this.labelControl5);
            base.Controls.Add(this.btnCancel);
            base.Controls.Add(this.btnOK);
            base.Controls.Add(this.labelControl4);
            base.Controls.Add(this.edtKHJDQ);
            base.Controls.Add(this.labelControl3);
            base.Controls.Add(this.labelControl2);
            base.Controls.Add(this.edtGQ);
            base.Controls.Add(this.labelControl1);
            base.Name = "FrmGQKK";
            base.StartPosition = FormStartPosition.CenterParent;
            this.Text = "隔期扣款";
            this.edtGQ.Properties.EndInit();
            this.edtKHJDQ.Properties.EndInit();
            base.ResumeLayout(false);
            base.PerformLayout();
        }
    }
}

